package org.belkodevelop.form;

import org.belkodevelop.user.domain.User;

public class RegistrationForm {

    private String email = "";
    
    private String fullName = "";
    
    private String password = "";
    
    private String confirmPassword = "";
    
    private String captchaCode = "";

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public void setConfirmPassword(String confirmPassword) {
        this.confirmPassword = confirmPassword;
    }
    
    public String getConfirmPassword() {
        return confirmPassword;
    }
    
    public void setCaptchaCode(String captchaCode) {
        this.captchaCode = captchaCode;
    }
    
    public String getCaptchaCode() {
        return captchaCode;
    }
    
    public void trim() {
        this.email = email.trim();
        this.fullName = fullName.trim();
        this.captchaCode = captchaCode.trim();
        this.password = password.trim();
        this.confirmPassword = confirmPassword.trim();
    }
    
    public User getUser() {
        User user = new User();
        user.setEmail(email);
        user.setLogin(email);
        user.setEnabled(true);
        user.setFullName(fullName);
        user.setPassword(password);
        return user;
    }
}
